package com.song.eduservice.client.vodfeign;

import com.song.commonutils.ResultObj;
import com.song.eduservice.hystrix.VodHystrixFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @author song
 * @data 2020/4/2
 */

@FeignClient(name = "service-vod", fallback = VodHystrixFactory.class)
@Component
public interface VodFeign {

    /**
     * 上传视频
     *
     * @param file
     * @return
     */

    @PostMapping(value = "/eduvod/video/uploadAlyiVideo", consumes = "multipart/form-data")
    String uploadAlyiVideo(MultipartFile file);

    /**
     * 删除视频
     *
     * @param id
     * @return
     */
    @DeleteMapping("/eduvod/video/{id}")
    ResultObj deleteAlyVideo(@PathVariable("id") String id);

    /**
     * 批量删除视频
     *
     * @param videoIdList
     */
    @DeleteMapping("/eduvod/video/deleteBatch")
    void deleteBatchVideo(@RequestParam("videoIdList") List<String> videoIdList);
}
